# Contributor: Rasmus Thomsen <oss@cogitri.dev>
# Maintainer: Rasmus Thomsen <oss@cogitri.dev>
pkgname=openrc-settingsd
pkgver=1.0.1
pkgrel=5
pkgdesc="System settings D-Bus service for OpenRC"
url="https://gitweb.gentoo.org/proj/openrc-settingsd.git"
arch="all"
license="GPL-2.0-or-later"
depends="tzdata"
makedepends="glib-dev dbus-dev openrc-dev polkit-dev libdaemon-dev automake autoconf
	libtool bash"
subpackages="$pkgname-doc $pkgname-openrc"
source="https://gitweb.gentoo.org/proj/openrc-settingsd.git/snapshot/openrc-settingsd-$pkgver.tar.gz
	use-profiled-instead-of-envd.patch
	0001-Make-etc-localtime-a-symlink-if-it-doesn-t-exist-yet.patch
	0002-Ensure-0664-permissions-on-etc-localtime.patch
	"

prepare() {
	default_prepare

	sed -i -e 's:/sbin/runscript:/sbin/openrc-run:g' data/init.d/openrc-settingsd.in

	autoreconf -if
}

build() {
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--localstatedir=/var \
		--with-pidfile=/run/openrc-settingsd.pid
	make SHELL="/bin/bash"
}

check() {
	make check
}

package() {
	make DESTDIR="$pkgdir" install
}

sha512sums="bca589de7d2c96d8d15d93882b7296523a0d6301fe1d33f7fc03386544b5c050f2d819b9e1f005ee10a794883175ea1b1172411aad3598f967a6a5677a5c4aad  openrc-settingsd-1.0.1.tar.gz
d06d691c1ef52c0e4c5d68ad7d25eba73ad8fffa3d3675f5c79ff93808131c11f4dbbd13db64c463bb87ec8ebed143878703ba281e1241947d66fcad48063e56  use-profiled-instead-of-envd.patch
7ea84475fe6558d7b26726eefd452e89cb407a9e9beeff70163c1ec1f236988ae0b7e85644ca2baad7238d0c304bc54d899889605dd08e5cc60cbaf8b5e9abe5  0001-Make-etc-localtime-a-symlink-if-it-doesn-t-exist-yet.patch
2f1008b129472264ebeba985c6355a7317266b3d15dd7e9a2394930a8c4c61761315b005a4632b623957a269bae9f76db1f9e2430afaf042955231a480a5ece8  0002-Ensure-0664-permissions-on-etc-localtime.patch"
